import API_CONFIG from '@/config/api_config/index'
import { dataSource } from './dataSource'

const API = { ...API_CONFIG }
export default function (apiName, ...arg) {
	const [apiModule, apiFunc] = apiName.split('.')
	if (!API[apiModule][apiFunc]) {
		console.warn('warn:api接口命名有误')
		return false
	}
	const options = API[apiModule][apiFunc](...arg)
	return dataSource(options)
}
